gh-69619: Clarify whitespace definition in str.strip docs#150021
Conversation
Documentation build overview
|
| The *chars* argument is not a prefix or suffix; rather, all combinations of its | ||
| values are stripped. | ||
|
|
||
| Whitespace characters are those defined by Unicode as spaces, tabs, and newline characters. |
There was a problem hiding this comment.
This is inaccurate, the UCD defines properties, not such categories. For example, the file separator is not covered by your sentence:
>>> '\x1c'.isspace()
True
>>> '\x1c'.strip()
''I think it would be simpler to link to str.isspace(), which already lists all the properties precisely.
|
Thanks @Daniil20xx for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @Daniil20xx for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
|
Thanks @Daniil20xx for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
Thank you! |
|
GH-150047 is a backport of this pull request to the 3.13 branch. |
|
GH-150048 is a backport of this pull request to the 3.14 branch. |
|
GH-150049 is a backport of this pull request to the 3.15 branch. |
Clarify that whitespace characters in str.strip are defined by Unicode,
including spaces, tabs, and newline characters.